package generator.template;

public class ExistsGenerator {

	public static String generate(String path, String type, String condition, int existsCounter) {
		return "\n\t\tprivate function exists"+type+""+existsCounter+"(colecao:Vector.<"+type+">):Boolean{\n"+
				"\t\t\tfor each (var value:"+type+" in colecao){\n"+
				"\t\t\t\tif(value."+condition+"){\n"+
				"\t\t\t\t\treturn true;\n"+
				"\t\t\t\t}\n"+
				"\t\t\t}\n"+
				"\t\t\treturn false;\n"+
				"\t\t}\n";
	}

}
